From: Florian Müllner Date: Thu, 10 May 2012 11:16:15 +0000 (+0200) Subject: userMenu: Hide "Log out" item on single user machines X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~6600 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=518282e169;p=gnome-shell.git userMenu: Hide "Log out" item on single user machines Ignoring remote logins, the "Log out" action is meaningless for single user setups. Do not show it in that case. https://bugzilla.gnome.org/show_bug.cgi?id=675802 --- diff --git a/js/ui/userMenu.js b/js/ui/userMenu.js index 93f4dc337..5b46ca801 100644 --- a/js/ui/userMenu.js +++ b/js/ui/userMenu.js @@ -497,13 +497,13 @@ const UserMenuButton = new Lang.Class({ })); this._userManager.connect('notify::is-loaded', - Lang.bind(this, this._updateSwitchUser)); + Lang.bind(this, this._updateMultiUser)); this._userManager.connect('notify::has-multiple-users', - Lang.bind(this, this._updateSwitchUser)); + Lang.bind(this, this._updateMultiUser)); this._userManager.connect('user-added', - Lang.bind(this, this._updateSwitchUser)); + Lang.bind(this, this._updateMultiUser)); this._userManager.connect('user-removed', - Lang.bind(this, this._updateSwitchUser)); + Lang.bind(this, this._updateMultiUser)); this._lockdownSettings.connect('changed::' + DISABLE_USER_SWITCH_KEY, Lang.bind(this, this._updateSwitchUser)); this._lockdownSettings.connect('changed::' + DISABLE_LOG_OUT_KEY, @@ -542,6 +542,11 @@ const UserMenuButton = new Lang.Class({ this._name.set_text(""); }, + _updateMultiUser: function() { + this._updateSwitchUser(); + this._updateLogout(); + }, + _updateSwitchUser: function() { let allowSwitch = !this._lockdownSettings.get_boolean(DISABLE_USER_SWITCH_KEY); this._loginScreenItem.actor.visible = allowSwitch && @@ -551,7 +556,7 @@ const UserMenuButton = new Lang.Class({ _updateLogout: function() { let allowLogout = !this._lockdownSettings.get_boolean(DISABLE_LOG_OUT_KEY); - this._logoutItem.actor.visible = allowLogout; + this._logoutItem.actor.visible = allowLogout && this._userManager.has_multiple_users; }, _updateLockScreen: function() {